package com.wangxq.yd_base;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.wangxq.yd_base.mvp.ui.activity.TestActivity;
import com.zlx.module_base.base_util.LogUtils;
import com.zlx.widget.zxing.android.CaptureActivity;

import butterknife.BindView;
import butterknife.OnClick;
public class MainActivity extends AppCompatActivity {
@BindView(R.id.tv)
    TextView tv;
    @BindView(R.id.btn_login)
    Button btnLogin;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.tv).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(MainActivity.this, TestActivity.class));
            }
        });
        findViewById(R.id.tv_scan).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, CaptureActivity.class);
                startActivityForResult(intent, 0x0000);
            }
        });
//        ViewUtils.setEnabled(btnLogin, true);
    }
    @OnClick(R.id.tv)
    public void tv(){
        startActivity(new Intent(MainActivity.this, TestActivity.class));
    }


    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == 0x0000 && resultCode == RESULT_OK) {
            if (data != null) {
                String content = data.getStringExtra("codedContent");
                LogUtils.d(content);
            }
        }
    }

}